// 通用响应类型
export interface ApiResponse<T = any> {
  code: number;
  message: string;
  data: T;
}

// 分页数据类型
export interface PaginatedData<T> {
  items: Array<T>;
  count: number;
}

// 分页响应类型
export interface PaginatedResponse<T> {
  code: number;
  message: string;
  data: {
    items: T[];
    count: number;
  };
}

// 用户相关类型
export interface UserLoginRequest {
  username_or_email: string;
  password: string;
}

export interface UserRegisterRequest {
  username: string;
  email: string;
  password: string;
  phone?: string;
  nickname?: string;
  avatar?: string;
  bio?: string;
}

export interface UserUpdateRequest {
  nickname?: string;
  avatar?: string;
  bio?: string;
}

export interface TokenResponse {
  token: string;
}

// 作品相关类型
export interface ArtworkCreateRequest {
  title: string;
  description?: string;
  file_url: string;
  file_type: string;
  category: string;
  tags?: string[];
}

export interface ArtworkUpdateRequest {
  title?: string;
  description?: string;
  category?: string;
  tags?: string[];
}

export interface ArtworkResponse {
  id: number;
  title: string;
  description: string | null;
  file_url: string;
  file_type: string;
  creator_id: number;
  category: string;
  tags: string[];
  created_at: string;
  updated_at: string;
}

// 元数据相关类型
export interface MetadataCreateRequest {
  artwork_id: string;
  model_used: string;
  prompt: string;
  generated_time: string;
  extra_info?: Record<string, any>;
}

export interface MetadataResponse {
  id: number | null;
  artwork_id: string;
  model_used: string;
  prompt: string;
  generated_time: string;
  extra_info?: Record<string, any>;
  created_at: string;
  updated_at: string;
}

// 社区相关类型
export interface CommentIn {
  user_id: number;
  work_id: number;
  content: string;
  parent_id?: number | null;
  like_count?: number;
}

export interface CommentCreateRequest {
  user_id: number;
  work_id: number;
  content: string;
  parent_id?: number;
}

export interface CommentResponse {
  id: number;
  user_id: number;
  work_id: number;
  content: string;
  parent_id: number | null;
  like_count: number;
  created_at: string;
  updated_at: string;
}

export interface TopicCreateRequest {
  user_id: number;
  title: string;
  content: string;
}

export interface TopicResponse {
  id: number;
  user_id: number;
  title: string;
  content: string;
  like_count: number;
  is_liked: boolean;
  created_at: string;
  updated_at: string;
}

export interface TopicCommentCreateRequest {
  user_id: number;
  topic_id: number;
  content: string;
  parent_id?: number;
}

export interface TopicCommentUpdateRequest {
  user_id: number;
  topic_id: number;
  content: string;
  parent_id?: number;
}

export interface TopicCommentResponse {
  id: number;
  user_id: number;
  topic_id: number;
  content: string;
  parent_id: number | null;
  like_count: number;
  created_at: string;
  updated_at: string;
}

export interface FollowCreateRequest {
  follower_id: number;
  followed_id: number;
}

export interface FollowResponse {
  id: number;
  follower_id: number;
  followed_id: number;
  created_at: string;
}

// 文件相关类型
export interface FileResponse {
  id: number;
  file_name: string;
  file_type: string;
  file_size: number;
  upload_time: string;
  url: string;
}

export interface FileListResponse {
  code: number;
  message: string;
  data: FileResponse[];
} 